#ifndef REALTIMEDATA_H
#define REALTIMEDATA_H

#include <QWidget>
#include <QtCharts>
#include <QVBoxLayout>
#include <QTimer>
#include <QtMqtt/QMqttClient>
#include <QtMqtt/QMqttTopicName>

namespace Ui {
class RealtimeData;
}

class RealtimeData : public QWidget
{
    Q_OBJECT

public:
    explicit RealtimeData(QWidget *parent = nullptr);
    ~RealtimeData();

private slots:
    void on_comboBox_device_currentTextChanged(const QString &arg1);

private:
    Ui::RealtimeData *ui;

    double temperature;
    double humidity;

    QVBoxLayout* layout_temperature;
    QVBoxLayout* layout_humidity;

    QChart *chart_temperature;
    QLineSeries *series_temperature;
    QChartView *chartView_temperature;

    QChart *chart_humidity;
    QLineSeries *series_humidity;
    QChartView *chartView_humidity;
    QDateTimeAxis* axisX_temperature;
    QDateTimeAxis* axisX_humidity;
    QValueAxis* axisY;


    void chart_temperature_init();
    void comBoxDeviceInit();
};

#endif // REALTIMEDATA_H
